package org.domain.sigepac.Entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.Max;
import org.hibernate.validator.NotNull;

@Entity
@Table(name = "tb_avaliacao_informatica")
public class AvaliacaoInformatica extends EntidadeAbstrata implements Cloneable {

	private static final long serialVersionUID = -6088931453148770266L;

	@Override
	public AvaliacaoInformatica clone() throws CloneNotSupportedException {
		return (AvaliacaoInformatica) super.clone();
	}

	@EmbeddedId
	private AvaliacaoInformaticaId id=new AvaliacaoInformaticaId();

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_aluno", insertable = false, updatable = false)
	private Aluno aluno;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_turma", insertable = false, updatable = false)
	private Turma turma;

	@Column(name="nota_inicial",nullable=false)
	@NotNull
	@Max(value=10,message="A nota m\u00e1xima \u00e9 10")
	private Integer notaInicial;


	@Column(name="nota_final",nullable=false)
	@NotNull
	@Max(value=10,message="A nota m\u00e1xima \u00e9 10")
	private Integer notaFinal;


	public Serializable getId() {
		// TODO Auto-generated method stub
		return id;
	}

	public void setId(AvaliacaoInformaticaId id) {
		this.id = id;
	}

	public Aluno getAluno() {
		return aluno;
	}


	public void setAluno(Aluno aluno) {
		this.aluno = aluno;
	}

	public Turma getTurma() {
		return turma;
	}
	public void setTurma(Turma turma) {
		this.turma = turma;
	}

	public Integer getNotaInicial() {
		return notaInicial;
	}

	public void setNotaInicial(Integer notaInicial) {
		this.notaInicial = notaInicial;
	}

	public Integer getNotaFinal() {
		return notaFinal;
	}

	public void setNotaFinal(Integer notaFinal) {
		this.notaFinal = notaFinal;
	}


}
